<!DOCTYPE html>
<head>
    <title>Forgot Password</title>
    <meta name="keywords" content="" />
    <meta name="description" content="" />
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">

    <link href="css/font-awesome.min.css" rel="stylesheet" type="text/css">
    <link href="css/bootstrap1.css" rel="stylesheet" type="text/css">
    <link href="css/bootstrap-theme.min.css" rel="stylesheet" type="text/css">
    <link href="css/forgetPsd.css" rel="stylesheet" type="text/css">
    <link rel="stylesheet" href="css/header.css">
    <link rel="stylesheet" href="css/footer.css">
</head>
<body class="templatemo-bg-gray">
<div class="container">
    <div class="col-md-12">
        <h1 class="margin-bottom-15">Password Reset</h1>
        <form class="form-horizontal templatemo-forgot-password-form templatemo-container" role="form" action="#" method="post">
            <div class="form-group">
                <div class="col-md-12">
                    Please enter your email address that you registered in our website.
                </div>
            </div>
            <div class="form-group">
                <div class="col-md-12">
                    <input type="text" class="form-control" id="email" placeholder="Your email">
                </div>
            </div>
            <div class="form-group">
                <div class="col-md-12">
                    <input type="submit" value="Submit" onclick="sendEmail();">
                    <br><br>
                    <a href="index.html">&nbsp;首页</a>&nbsp;&nbsp;|&nbsp;&nbsp;
                    <a href="userLogin.html">登录</a>&nbsp;&nbsp;|&nbsp;&nbsp;
                    <a href="userRegister.html">注册</a>
                </div>
            </div>
        </form>
    </div>
</div>
</body>
<script type="text/javascript">
    /*send email*/
    function sendEmail() {
        var email = document.getElementById("email").value;

        if(email == ""){
            alert("输入为空！请再次输入！");
        }else {
            alert(email);
            $.ajax({
                url:"http://123.206.47.215:8081/club_teacher/getPassword",
                type:"POST",
                data:
                    {
                        "email":$("#email").val()
                    },
                dataType:"json",
                success: function (data) {
                    alert(data.toString());
                    if (data.success=="false") {
                        alert(data.message);
                    }else {
                        alert(data.message);
                    }
                },
                error: function () {
                    alert("请求失败！")
                }
            })
        }

    }
</script>
</html>